if totalPage <= 0 || currentPage > totalPage
    return
startPage = currentPage - 2
if startPage < 1
    startPage = 1

endPage = currentPage + 2
if endPage > totalPage 
    endPage = totalPage

.pagination
    ul
        if currentPage <= 4
            startPage = 1
        if (totalPage - currentPage) < 4
            endPage = totalPage

        if currentPage == 1
            li
                span.currenttext &larr; 上一页
        else
            li
                a.prev_page(href="#{actionUrl}#{currentPage - 1}#{urlParas}") &larr; 上一页

        if currentPage > 4
            li
                a(href="#{actionUrl}1#{urlParas}") 1
            li 
                span.currenttext …

        i = startPage;
        while i <= endPage
            li
                if currentPage == i
                    span.currenttext #{i}
                else
                    a(href="#{actionUrl}#{i}#{urlParas}") #{i}
            i = i + 1

        if (totalPage - currentPage) >= 4
            li
                span.currenttext …
            li
                a(href="#{actionUrl}#{totalPage}#{urlParas}") #{totalPage}
    
        if currentPage == totalPage
            li
                span.currenttext 下一页 &rarr;
        else
            li
                a(href="#{actionUrl}#{currentPage + 1}#{urlParas}") 下一页 &rarr;